]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/network: Bind subtitle
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Sat, 4 Feb 2023 17:57:20 +0000 (14:57 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Sat, 4 Feb 2023 20:46:54 +0000 (17:46 -0300)
Instead of map the currently active items - for whatever they are -
into the quick toggle title, bind it to the subtitle.

This leaves room for setting static titles for device-backed
networks, such as Wi-Fi, Wired, Bluetooth, etc.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2619>

js/ui/status/network.js

index 9c393b34eb1dcd84297814124659e3078fa2be8c..7057241a1b9acd6d93e1a9e4eea9ced9c532da0c 100644 (file)
@@ -1319,8 +1319,8 @@ const NMToggle = GObject.registerClass({
         this._itemBinding.bind('icon-name',
             this, 'icon-name', GObject.BindingFlags.DEFAULT);
         this._itemBinding.bind_full('name',
-            this, 'title', GObject.BindingFlags.DEFAULT,
-            (bind, source) => [true, this._transformTitle(source)],
+            this, 'subtitle', GObject.BindingFlags.DEFAULT,
+            (bind, source) => [true, this._transformSubtitle(source)],
             null);
 
         this.connect('clicked', () => this.activate());
@@ -1360,7 +1360,7 @@ const NMToggle = GObject.registerClass({
     // transform function for property binding:
     // Ignore the provided label if there are multiple active
     // items, and replace it with something like "VPN (2)"
-    _transformTitle(source) {
+    _transformSubtitle(source) {
         const nActive = this.checked
             ? [...this._getActiveItems()].length
             : 0;